package com.you.raft.common.entity;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

@Builder
@Data
public class Request implements Serializable {

    /**
     * 投票请求
     */
    public static final int VOTE = 0;
    /**
     * 附加日志请求
     */
    public static final int APPEND_ENTRIES = 1;

    /**
     * 客户端请求
     */
    public static final int CLIENT_ORDER = 2;

    /**
     * 请求类型
     */
    private int cmd = -1;

    /**
     * 请求地址
     */
    private String addr;

    /**
     * 请求内容
     */
    private Object obj;


    public Request() {
    }

    public Request(int cmd, String addr, Object obj) {
        this.cmd = cmd;
        this.addr = addr;
        this.obj = obj;
    }

}
